package com.example.music;

import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.Contacts.People;
import android.provider.ContactsContract;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.SimpleCursorAdapter;
/**
 * 
 * @author develop
 *
 */
public class myFavourite extends Activity{
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
//		setContentView(R.layout.tablayout4);
		ListView list=new ListView(this);
		Cursor cursor=getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
		startManagingCursor(cursor);
		ListAdapter listAdapter=new SimpleCursorAdapter(this, android.R.layout.simple_expandable_list_item_1,
				cursor, 
				new String[]{ContactsContract.Contacts.DISPLAY_NAME}, 
				new int[]{android.R.id.text1});
		list.setAdapter(listAdapter);
		setContentView(list);
	}

}
